package id.link.win.login.sample.login.dto;

import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;

/**
 * Created with IntelliJ IDEA.
 *
 * @author: Foy Lian
 * Date: 7/19/2019
 * Time: 11:33 AM
 */
@JsonNaming(PropertyNamingStrategy.UpperCamelCaseStrategy.class)
public class LoginResult {
    private int code;
    private String msg;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public LoginResult setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public static LoginResult ok() {
        LoginResult result = new LoginResult();
        result.code = 200;
        return result;
    }

    public static LoginResult failure(String msg) {
        LoginResult result = new LoginResult();
        result.code = 9999;
        result.msg = msg;
        return result;
    }
}
